package cn.edu.service.impl;

import cn.edu.entity.Emp;
import cn.edu.mapper.EmpMapper;
import cn.edu.service.EmpService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;


/**
 * @author Mr.ma
 * @since 2022/11/17 14:43
 **/
@Service
public class EmpServiceImpl implements EmpService {
    @Resource
    private EmpMapper empMapper;

    @Override
    public Page<Emp> selectAll(Integer pageCount, Integer pageSize) {
        Page<Emp> page = new Page<>(pageCount,pageSize);
        Page<Emp> empPage = empMapper.selectPage(page, null);
        return empPage;
    }

    @Override
    public int insert(Emp emp) {
        return empMapper.insert(emp);
    }

    @Override
    public Emp selectById(int id) {
        return empMapper.selectById(id);
    }

    @Override
    public int updateById(Emp emp) {
        return empMapper.updateById(emp);
    }

    @Override
    public int deleteById(int id) {
        return empMapper.deleteById(id);
    }
}
